package org.hc.handler;

import org.hc.config.RabbitMqConfig;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class MessageHandler {

    //绑定sms队列的方法

    @RabbitListener(queues = {RabbitMqConfig.QUEUE_INFORM_SMS})
    public void xxx(String msg, Message message, Channel channel){

        System.out.println("sms message："+msg);
    }

    //绑定email队列方法
    @RabbitListener(queues = {RabbitMqConfig.QUEUE_INFORM_EMAIL})
    public void yyy(String msg, Message message, Channel channel)
    {
        System.out.println("email message："+msg);
    }
}
